web/src/pages/search/[...searchTerm].astro

36 lines · 883 bytes

 1---
 2import Layout from '@layouts/Layout.astro';
 3import Search from '@components/things/Search.svelte';
 4import SearchResults from '@components/things/SearchResults.svelte';
 5
 6export const prerender = false;
 7
 8const searchTerm = Astro.params.searchTerm || '';
 9---
10
11<Layout title={`Search: ${searchTerm} | Awesome Privacy`}>
12	<section class="search-box">
13		<h1>Search</h1>
14		<Search client:visible previousSearch={searchTerm} />
15	</section>
16	<SearchResults client:load searchTerm={searchTerm} />
17</Layout>
18
19<style lang="scss">
20	.search-box {
21		display: flex;
22		flex-direction: column;
23		margin: var(--space-lg) auto;
24		padding: var(--space-md);
25		width: calc(100% - 2rem);
26		max-width: var(--width-container);
27
28		h1 {
29			font-size: var(--text-4xl);
30			color: var(--accent-3-text);
31			font-family: var(--font-subtitle);
32			text-align: center;
33			margin: var(--space-md) 0;
34		}
35	}
36</style>